package com.whut.controller;


import com.whut.model.ProjectCheck;
import com.whut.service.ProjectCheckService;
import com.whut.v_vo.ProjectCheckVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/project_check")
public class ProjectCheckController {

    private final ProjectCheckService projectCheckService;

    public ProjectCheckController(ProjectCheckService projectCheckService) {
        this.projectCheckService = projectCheckService;
    }

    @GetMapping("/all")
    public List<ProjectCheckVO> all() {
        return projectCheckService.all();
    }

    @PostMapping
    public ProjectCheck save(String name) {
        return projectCheckService.save(name);
    }

}
